package com.ctgu.chatapp.view.adapter

import androidx.recyclerview.widget.DiffUtil
import com.ctgu.chatapp.showPojo.FriendMsg

class DiffCallBackForMsg(var oldList: List<FriendMsg>, var newList: List<FriendMsg>) :
    DiffUtil.Callback() {
    override fun getOldListSize() = oldList.size

    override fun getNewListSize() = newList.size

    override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int) =
        oldList[oldItemPosition].friendID == newList[newItemPosition].friendID

    override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int) =
        oldList[oldItemPosition].context == newList[newItemPosition].context
}